package com.example.demo3.mapper;

import com.example.demo3.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageInfoMapper {
//"INSERT INTO message_info (`from`, `to`, `message`) VALUES (#{from}, #{to}, #{message})"
    @Insert("insert into message_info (`from`, `to`, `message`) values (#{from}, #{to}, #{message})")
    Integer insert(MessageInfo messageInfo);

    @Select("select * from message_info ")
    List<MessageInfo> selectAll();

}
